Skip to content

Conversation

@jjnp
Copy link
Contributor

@jjnp jjnp commented Jun 17, 2021

This should help prevent bugs in the future, since some bugs already occurred that would have been mitigated by the changes signature and documentation.

ATTENTION: This is a breaking change, since it alters the constructor signature of GeoCell. I understand if that isn't acceptable. In that case at least the documentation should remain.

The bug is the following: When using GeoCell, the size determines how often the nodes supplied are iterated on. This is perfectly fine when the 'nodes' are functions that generate those nodes, i.e. if they are callable. If they aren't, however, because someone wanted to supply nodes directly (which is clearly a valid use case since this is specifically checked for in the code), the nodes are materialized instead. Now this is fine generally speaking, but if size > 1, then materialize is called more than once per node, which is incorrect behavior and leads to an incorrect topology.

Because of that I figured it would make sense to change the signature to a variable with a default value of 1, such that someone not knowing what this parameter affects exactly uses a value that doesn't cause problems. I also added documentation outlining that behaviour.

EDIT: This is what a topology looks like if GeoCell is used in the way I outlined:
image
It should look like this instead:
image

jjnp added 3 commits June 17, 2021 19:18
This should help prevent bugs in the future, since some bugs already occurred that would have been mitigated by the changes signature and documentation.

Signed-off-by: Jacob Palecek <[email protected]>
This should help prevent bugs in the future, since some bugs already occurred that would have been mitigated by the changes signature and documentation.

Signed-off-by: Jacob Palecek <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants